package cqrtplm.vo;

import cn.hutool.core.map.MapUtil;
import cqrtplm.dto.query.DspfStatusBaseQueryDTO;
import lombok.Data;

import java.math.BigInteger;
import java.util.Date;
import java.util.Map;

/**
 * @description:
 * @author: zhengxiong.jiang
 * @createDate: 2025-07-11
 * @version: 1.0
 */
@Data
public class DspfStatusBaseVO {
    private String referEBomID;
    private String referMBomID;
    //来源
    private Integer bomType;
    //EBOM码
    private String ebomcode="";
    //成品码
    private String refermbomcode = "";
    //开发令
    private String devcode;
    //公司机型
    private String producttype;
    private String moduleID;
    //客户编码
    private String customecode;
    private String bomDescr;
    //EBOM描述
    private String ebomDescr = "";
    //状态表描述
    private String statedescription = "";
    private Boolean isHalfBom;
    //推荐级别
    private String priority;
    private String statusID;
    private String baseBomID;
    //销售国家
    private String saleToCountry;
    //创建时间
    private Date fCreateDate;
    private String isUserStatusID;
    private String fCreateUserId;
    //创建人
    private String fcreateUserName;
    private Date fModifyDate;
    private String fModifyUserId;
    private String fModifyUserName;
    //V2机型
    private String producttypev2;
    private Integer status;
    //备注
    private String fdescription;
    private Integer eBomStatus;
    //需求名称(状态表名称)
    private String statustitle = "";
    //需求编码
    private String statuscode = "";
    //半BOM 是/否
    private String halfBOM;
    //测试要求
    private String testRequire;
    //越南生产
    private String madeVietnam;
    //样机 是/否
    private String modelMachine;
    //是否已批量
    private String SFBatch;
    //需小批 是/否
    private String needBatch;
    //认证要求
    private String certificationRequire;
    //EBOMID
    private BigInteger fatherOid;
    //EBOM类型
    private String fatherOtype;
    //EBOM编码
    private String fatherNumber;

    public DspfStatusBaseVO () {

    }

    public DspfStatusBaseVO (Map<String,String> ibaMap, Map<String,Object> map, DspfStatusBaseQueryDTO dto) {
        this.fdescription = ibaMap.get("REMARK")==null?"":ibaMap.get("REMARK");
        this.priority = ibaMap.get("RecommendLevel")==null?"":ibaMap.get("RecommendLevel");
        this.ebomDescr = map.get("DESCRIPTION")==null?"":map.get("DESCRIPTION").toString();
        this.statustitle = map.get("NAME")==null?"":map.get("NAME").toString();
        this.devcode = dto.getDevcode();
        this.producttype = dto.getProducttype();
        this.producttypev2 = ibaMap.get("productTypeV2")==null?"":ibaMap.get("productTypeV2");
        this.fModifyDate = (Date) map.get("MODIFYSTAMP");
//        this.fcreateUserName = vo.getCreatorName()==null?"":vo.getCreatorName();
        this.halfBOM = ibaMap.get("HalfBOM")==null?"":ibaMap.get("HalfBOM");
        this.testRequire = ibaMap.get("TestRequire")==null?"":ibaMap.get("TestRequire");
        this.madeVietnam = ibaMap.get("MadeVietnam")==null?"":ibaMap.get("MadeVietnam");
        this.modelMachine = ibaMap.get("ModelMachine")==null?"":ibaMap.get("ModelMachine");
        this.SFBatch = ibaMap.get("SFBatch")==null?"":ibaMap.get("SFBatch");
        this.needBatch = ibaMap.get("NeedBatch")==null?"":ibaMap.get("NeedBatch");
        this.certificationRequire = ibaMap.get("CertificationRequire")==null?"":ibaMap.get("CertificationRequire");
        this.fatherOid = new BigInteger(map.get("EBOMOID").toString());
        this.fatherOtype = map.get("TYPEOTYPE")==null?"":map.get("TYPEOTYPE").toString();
        this.fatherNumber = map.get("PARTNUMBER")==null?"":map.get("PARTNUMBER").toString();
        this.ebomcode = map.get("PARTNUMBER")==null?"":map.get("PARTNUMBER").toString();
    }

}
